home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / manual.txt < prev    next >
Text File  |  1995-04-22  |  74KB  |  1,783 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                REFERENCE MANUAL 
  9.  
  10.                                FOR THE MINIX 1.5 
  11.  
  12.                               DEMONSTRATION DISK 
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                               ANDREW S. TANENBAUM 
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.                               Prentice Hall, Inc 
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. Copyright 1991 Prentice Hall, Inc. 
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.                                                                                
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                        1 
  63.  
  64.  
  65.  
  66.  
  67.                                  INTRODUCTION 
  68.  
  69.    Every computer needs an operating system to manage its memory,  control  its 
  70. I/O  devices,  implement its file system and provide an interface to its users. 
  71. Many operating systems exist, such as MS-DOS, OS/2, and UNIX.  This manual pro- 
  72. vides  a  very  brief  introduction  to another operating system, MINIX.  It is 
  73. intended to accompany the MINIX demonstration diskette. 
  74.    Although MINIX was inspired by the well-known AT&T  UNIX  operating  system, 
  75. its  design  and implementation are completely new.  It does not contain even a 
  76. single line of AT&T code: not in the operating system, not in the  C  compiler, 
  77. and  not  in  any  of the nearly 200 utility programs supplied with MINIX.  For 
  78. this reason, it is possible to include not only all the binary  programs,  but, 
  79. virtually  all  the  source code of the operating system and utilities as well. 
  80. In this way, people can study MINIX in detail to learn how a  modern  operating 
  81. system  is constructed, and can also modify it to suit their own tastes if need 
  82. be. 
  83.    Before getting started, we would like to point out that this manual and  the 
  84. accompanying  demonstration  diskette  only deal with a tiny fraction of MINIX, 
  85. just to give the flavor of the system.  If your  favorite  feature  (e.g.,  the 
  86. Berkeley  vi  editor)  is  not present here, that does not mean that it is also 
  87. absent from the full system.  The standard MINIX distribution for the  IBM  PC, 
  88. for  example,  is  17  diskettes,  whereas  the demonstration program is only 1 
  89. diskette.  Similarly, the manual that comes with MINIX is 680 pages,  including 
  90. a cross-referenced listing of the operating system source code itself, in C. 
  91.    Some of the differences between the demonstration system and full MINIX  are 
  92. given in the table below. 
  93.  
  94.  
  95.                                        1 
  96.  
  97.  
  98. 2                                INTRODUCTION                          CHAP.  1 
  99.  
  100.  
  101.  
  102.  Item                                    Demonstration disk   Full MINIX 
  103.  ----                                    ------------------   ---------- 
  104.  Complete operating system provided?     Yes                  Yes 
  105.  Complete shell provided?                Yes                  Yes 
  106.  Printer supported?                      Yes                  Yes 
  107.  RAM disk supported?                     Yes                  Yes 
  108.  Floppy disk supported?                  Yes                  Yes 
  109.  Hard disk supported?                    Yes                  Yes 
  110.  RS-232 serial lines supported?          Yes                  Yes 
  111.  Real mode supported?                    Yes                  Yes 
  112.  Protected mode supported?               No                   Yes 
  113.  Ethernet supported?                     No                   Yes 
  114.  Version 7 system calls supported?       Yes                  Yes 
  115.  Operating system source provided?       No                   Yes 
  116.  Utility program source provided?        No                   Yes 
  117.  Multiprogramming supported?             Yes                  Yes 
  118.  C compiler provided?                    No                   Yes 
  119.  Mountable file systems supported?       Yes                  Yes 
  120.  Remote login supported?                 No                   Yes 
  121.  Network file transfer supported?        No                   Yes 
  122.  Number of Editors provided:             1                    5 
  123.  Communication software provided:        No                   Kermit, zmodem 
  124.  Maximum number of simultaneous users:   1                    3 
  125.  Approximate number of utilities:        25                   190 
  126.  
  127. In addition to the IBM version (8088, 8086, 80286, 80386), MINIX is also avail- 
  128. able  for  the  Atari, Amiga, and Macintosh.  A version for the SPARC is in the 
  129. works and will be available in 1991. 
  130.  
  131.  
  132. 1.1.  BOOTING MINIX 
  133.  
  134.    The steps below will tell you how to boot MINIX on your computer.  One  word 
  135. of  warning, however, concerning running MINIX on IBM clones.  Although it will 
  136. work perfectly with all clones that are compatible with the IBM hardware, there 
  137. are  a small number of clones that deviate from the IBM hardware and mask these  
  138.  
  139. SEC.  1.1                        BOOTING MINIX                                3 
  140.  
  141. differences in the BIOS.  Since MINIX does not generally use the BIOS,  it  may 
  142. not  run on these machines.  If the demonstration disk works on your system, it 
  143. is very likely that full MINIX will work too, and vice versa. 
  144.    The problem you are most likely to encounter with the demonstration diskette 
  145. is  nonstandard  video  cards.   If the screen goes blank every 25 lines (which 
  146. will happen with some EGA cards that are not IBM compatible), hit  the  F3  key 
  147. once to enable software scrolling. 
  148.    Since there are no clones for the Atari, Amiga, and Macintosh,  these  prob- 
  149. lems  do  not  arise  there,  although  occasional problems do arise with peri- 
  150. pherals, such as hard disks, that are not compatible with the vendor's. 
  151.    This said, we can now boot MINIX in the following steps. 
  152.  
  153.    1. Turn off your computer. 
  154.  
  155.    2. Insert the demonstration disk in drive 0 (also called drive A). 
  156.  
  157.    3. Turn the computer on. 
  158.  
  159.    4. Wait for the menu, then hit the = key (i.e., equal sign) [IBM only]. 
  160.  
  161.    5. When it asks for the date, please enter a 12-digit number in the  form 
  162.       MMDDYYhhmmss,  followed  by a carriage return.  For example, 3:35 p.m. 
  163.       on July 4, 1976 was 070476153500. 
  164.  
  165.    6. When the login: prompt appears, type: 
  166.  
  167.            root 
  168.  
  169.       Please note that in  this  manual,  lines  printed  in  the  Helvetica 
  170.       typeface,  as  above,  are  lines  that  either  you  are  to  type in 
  171.       (literally) or lines that the computer will display.  It  will  always 
  172.       be  clear  from  the  context  which is which.  Always type a carriage 
  173.       return (ENTER key) after each line. 
  174.  
  175.    7. The computer (actually the shell) will now display: 
  176.  
  177.            # 
  178.  
  179.       to show that it is ready to accept a command. 
  180.  
  181.    8. To see what programs are available, type: 
  182.  
  183.            ls  -l  /bin 
  184.  
  185.       A list of file names of executable programs  will  be  displayed.   To 
  186.       keep  the  list  from  scrolling  out of view, type CTRL-S to stop the 
  187.       scroll and CTRL-Q to restart it.  (CTRL-S means depress the CTRL  key, 
  188.       and while holding it down, depress the S key.) You can also use: 
  189.  
  190.            ls  -C /bin 
  191.  
  192.       to get a short listing. 
  193.  
  194.    9. At this point you can run programs, make tests and so on.  Some  exam- 
  195.       ples  are  given  below.  If you are familar with UNIX you can try the 
  196.       various programs in /bin as most will be familiar. 
  197.  
  198.  
  199. 4                                INTRODUCTION                          CHAP.  1 
  200.  
  201.   10. When you are done using MINIX, type CTRL-D to log out.  login:  prompt 
  202.       will appear, and you can now turn off the computer or boot a different 
  203.       operating system. 
  204.  
  205.  
  206.  
  207. 1.2.  MAKING AND MOUNTING FILE SYSTEMS 
  208.  
  209.    As distributed, the demonstration disk is so full that  there  is  not  much 
  210. room  for  user  files.  Thus it is necessary to make a file system on disk and 
  211. copy some files there.  You may use either a diskette or a hard disk. 
  212.    The first step is to decide how large a file system you want to  make.   The 
  213. size  of  the  file  system  is  in  units of 1K blocks.  Thus a 360K 5.25-inch 
  214. diskette will hold 360 blocks, a 1.2M 5.25-inch diskette will hold 1200 blocks, 
  215. a  720K  3.5-inch  diskette will hold 720 blocks, and a 1.44M 3.5-inch diskette 
  216. will hold 1440 blocks.  If you wish to use a hard disk, pick an  unused  parti- 
  217. tion  and  determine  its size in 512-byte sectors using your present operating 
  218. system's software (e.g., fdisk).  Then divide the number of sectors by 2 to get 
  219. the  number  of  blocks,  rounding  downward  to an integer if there are an odd 
  220. number of sectors.  Finally, subtract 1 from this number if and only if you are 
  221. using  partition 1, to account for the boot block.  The number of blocks should 
  222. be between 360 and 32767. 
  223.    If you are using a diskette, insert it into drive 0 (drive A).   To  make  a 
  224. file  system, please use the mkfs command.  Below are several examples.  Do not 
  225. type the sharp sign (#) or the text following it, as this is simply commentary. 
  226.  
  227.      mkfs  /dev/fd0   360      # For a 360K 5.25-inch diskette 
  228.      mkfs  /dev/at0  1200      # For a 1.2M 5.25-inch diskette 
  229.      mkfs  /dev/ps0   720      # For a 720K 3.5-inch diskette 
  230.      mkfs  /dev/PS0  1440      # For a 1.44M 3.5-inch diskette 
  231.      mkfs  /dev/hd1  6800      # For a 6800-block hard disk partition 1 
  232.      mkfs  /dev/hd2 13600      # For a 13600-block hard disk partition 2 
  233.      mkfs  /dev/hd3 12041      # For a 12041-block hard disk partition 3 
  234.  
  235. You can also use drive 1 (drive B) by replacing the 0 at the end of the  device 
  236. name by a 1 (e.g., /dev/fd1). 
  237.    Having made an empty MINIX file system, you can now mount  it,  make  direc- 
  238. tories  on  it,  and  copy files to it, and remove files from the RAM disk.  To 
  239. perform this work, type the following commands (again, without typing the  com- 
  240. ments): 
  241.  
  242.      /etc/mount  /dev/fd0  /usr# Mount the new file system 
  243.      mkdir  /usr/bin           # Create a directory for binaries 
  244.      cp  /bin/*  /usr/bin      # Copy all the binaries 
  245.      rm  /bin/*                # Free up space on the RAM disk 
  246.      cp  /usr/bin/mined  /usr/bin/sh /bin   # Restore 2 programs 
  247.      df                        # See how much space you have 
  248.  
  249. You can now begin using MINIX.  However, if you  stop  using  it  and  wish  to  
  250.  
  251. SEC.  1.2              MAKING AND MOUNTING FILE SYSTEMS                       5 
  252.  
  253. reboot  it  later,  you need not go through this entire procedure again.  After 
  254. rebooting, mount the diskette or partition and remove the files from /bin  that 
  255. you do not need using rm.  It is best to restore at least mined and sh to /bin, 
  256. however, for speed. 
  257.  
  258.  
  259. 1.3.  USING THE MINED EDITOR 
  260.  
  261.    MINIX comes with five editors as follows: 
  262.  
  263.    1. Mined- A simple full screen editor 
  264.    2. Elle - An editor based on EMACS 
  265.    3. Vi   - A clone of the famous Berkeley vi editor 
  266.    4. Ex   - A clone of the famous Berkeley ex editor 
  267.    5. Ed   - A simple line-oriented editor 
  268.  
  269. The demonstration disk comes only with mined for two reasons.  First, mined  is 
  270. very  easy to learn.  In 15 minutes you will be an expert.  Second, it is quite 
  271. small; editors like vi and elle would take up too much space on the  demonstra- 
  272. tion disk. 
  273.    In this section we will give an introduction to mined.  See the manual  page 
  274. in  Chap.  2  for  more  details.   Since  the keyboard layouts for each of the 
  275. machines differs somewhat, we will describe the IBM keystrokes  here,  but  the 
  276. 68000  version will be given in parentheses.  To start mined with a sample file 
  277. type: 
  278.  
  279.      cp  /etc/text  mytext 
  280.      mined  mytext 
  281.  
  282. The first line copies the file /etc/text to mytext so we can modify it  without 
  283. affecting  the  original.   The second line starts the editor.  Within a second 
  284. your screen will contain 24 lines of a well-known poem by  Lewis  Carroll,  the 
  285. author  of  Alice  in  Wonderland.   The cursor will be positioned at the upper 
  286. left-hand corner of the screen, The bottom line will tell you the name  of  the 
  287. file,  its  length in lines, and its length in characters, displayed in reverse 
  288. video.  The bottom line will vanish as soon as the first key is struck, but can 
  289. be  recalled  by  hitting  the  middle key in the numeric keypad (i.e., the key 
  290. above the ``2'' and below the ``8'' (F5 on 68000). 
  291.    You can move the cursor around the  screen  using  the  arrow  keys  on  the 
  292. numeric keypad.  The HOME key (on the 68000, also HOME) puts it back at the top 
  293. of the file.  The END key (on the 68000, F6) moves it to the end of  the  file. 
  294. The  PGDN key (on the 68000, F3) scrolls the screen down by 24 lines.  The PGUP 
  295. key (on the 68000, F4) scrolls it up by 24 lines.  Using  these  keys  you  can 
  296. position the cursor anywhere in the file.  Try them now. 
  297.    You can enter new text by just typing it.  The new text  will  appear  under 
  298. the  cursor,  and  the  cursor  will  be  advanced  one  position.  There is no 
  299. automatic wraparound, so you must terminate each line using a  carriage  return 
  300. (ENTER  key).   Although  mined can handle lines greater than 80 characters, to 
  301.  
  302.  
  303. 6                                INTRODUCTION                          CHAP.  1 
  304.  
  305. keep things simple, restrict your input lines to less than  80  characters  for 
  306. the moment. 
  307.    If you make a typing error, use the BACKSPACE key to erase the character  to 
  308. the  left  of  the  cursor.   By  moving the cursor around the screen using the 
  309. arrows, you can erase any character by just positioning the cursor to the right 
  310. of the character to be erased.  The DEL key erases the character under the cur- 
  311. sor. 
  312.    With only the information given so far, you can  produce  any  document  you 
  313. need.  However, other commands exist to speed up editing.  For example, you can 
  314. move the cursor to the start or end of the current line  by  typing  CTRL-A  or 
  315. CTRL-Z,  respectively.  You can go forward or backward one word using CTRL-F or 
  316. CTRL-B, respectively.  You can scroll the screen down  or  up  one  line  using 
  317. CTRL-D or CTRL-U, respectively.  Try these. 
  318.    In addition to the BACKSPACE and DEL keys, other methods  are  provided  for 
  319. erasing  text.  CTRL-N deletes the next word (i.e., the one to the right of the 
  320. cursor).  CTRL-P deletes the previous word.  CTRL-T deletes  the  tail  of  the 
  321. current  line  (i.e.,  all  text  from  the cursor to the end of the line).  To 
  322. delete a block of text, first position the cursor at the start of the block and 
  323. type  CTRL-@  to  mark the start.  Then move the cursor one character after the 
  324. end of the block and type CTRL-K to kill it.  The text  will  vanish  from  the 
  325. screen,  but be saved in a hidden buffer.  You can now move the cursor anywhere 
  326. you want and type CTRL-Y to yank the contents of  the  hidden  buffer  out  and 
  327. insert it at the cursor.  Yanking does not change the hidden buffer, so you can 
  328. insert the same text in multiple places.  Try these commands to  see  how  they 
  329. work. 
  330.    You can search forward for a given piece of text by hitting the  large  plus 
  331. sign  (+) on the numeric keypad (on the 68000, F1).  You will be prompted for a 
  332. string.  After entering the string, type a carriage return.  The numeric  minus 
  333. sign  (-)  searches backwards (on the 68000, F2).  If you are familiar with the 
  334. magic characters allowed by the standard ed editor in  searches,  you  can  use 
  335. those here too. 
  336.    Although there are some more commands, with just these you  can  work  quite 
  337. efficiently.   Practice  a little bit now.  When you have finished editing your 
  338. file, type CTRL-W to write the file back to the (RAM) disk.   Then  exit  using 
  339. CTRL-X.   If  you type CTRL-X without first giving CTRL-W, you will be asked if 
  340. you want to save it.  Answer with ``y'' for yes and ``n'' for no.  After  exit- 
  341. ing the editor, you will be back in the shell, indicated by the sharp sign. 
  342.    You can create a new file, say foobar, by typing: 
  343.  
  344.      mined  foobar 
  345.  
  346. After entering the text and typing CTRL-W and CTRL-X, the file will be  present 
  347. on  the  disk.   Please note that only a small amount of free RAM disk space is 
  348. available initially, which limits the number and size  of  the  files  you  can 
  349. create.   You can remove programs that you do not need with rm.  This will give 
  350. you more space. 
  351.  
  352.  
  353. SEC.  1.4                       USING THE SHELL                               7 
  354.  
  355. 1.4.  USING THE SHELL 
  356.  
  357.    The MINIX shell  is  functionally  equivalent  to  the  standard  Version  7 
  358. (Bourne)  shell.  In this section we will give some examples of how it is used. 
  359. For more information, consult one of the many books on UNIX.  MINIX supports  a 
  360. hierarchical  directory  system.   Every  directory  has an absolute path name, 
  361. starting at the root directory /.  To change to the root directory, type: 
  362.  
  363.      cd  / 
  364.  
  365. You can find out what files and directories are located here by typing: 
  366.  
  367.      ls  -l 
  368.  
  369. You can create a new directory mydir by typing: 
  370.  
  371.      mkdir  mydir 
  372.  
  373. You can now change to that directory to make it your working directory with: 
  374.  
  375.      cd  mydir 
  376.  
  377. Try doing this, and then use mined to create a small file  called  file1  here. 
  378. You can examine the contents of this directory by typing: 
  379.  
  380.      ls  -l 
  381.  
  382. Now create a new directory inside mydir by typing: 
  383.  
  384.      mkdir  newdir 
  385.  
  386. Change to newdir using cd and create a file file2 there. You can find out where 
  387. you are by typing: 
  388.  
  389.      pwd 
  390.  
  391. Now change back to the root directory and examine your handiwork by typing: 
  392.  
  393.      cd  / 
  394.      ls  -l  mydir 
  395.      ls  -l  mydir/newdir 
  396.  
  397. Note the use of the slash character to indicate  subdirectories.   This  choice 
  398. conforms to UNIX usage, but is different than MS-DOS, which uses a backslash. 
  399.    To see how much space you have left, type: 
  400.  
  401.      df 
  402.  
  403. To get rid of all the files and directories you have just created, type: 
  404.  
  405.      rm  -rf  /mydir 
  406.  
  407. Now try df again to see how much space you have recovered. 
  408.    Some of the MINIX programs provided on the demonstration disk  are  filters. 
  409. That  is,  they  read  an input file, called standard input, process it in some 
  410. way, and write the results on standard output.  To  see  an  example  of  this, 
  411. type: 
  412.      head  -15  /etc/text 
  413.  
  414.  
  415. 8                                INTRODUCTION                          CHAP.  1 
  416.  
  417. which will extract the first 15 lines of /etc/text and write them  on  standard 
  418. output, which, by default, is the screen.  To redirect the output to a file, x, 
  419. type: 
  420.  
  421.      head  -15  /etc/text  >x 
  422.  
  423. You can examine x using mined or by copying it to the screen using: 
  424.  
  425.      cp  x  /dev/tty 
  426.  
  427. In a similar way, try: 
  428.  
  429.      tail  -5  /etc/text 
  430.  
  431. to see the last 5 lines of /etc/text. 
  432.    MINIX allows filters to be combined in a simple way.  If you type: 
  433.  
  434.      head  -15  /etc/text  |  tail  -5 
  435.  
  436. head will extract the first 15 lines of the file and pass  them  to  tail.   In 
  437. other  words,  the  input to tail will be the output from head.  Thus tail will 
  438. get lines 1 through 15 as its input, and extract the last 5 lines as  its  out- 
  439. put.  This will result in lines 11 through 15 of the original file appearing on 
  440. the screen.  When two (or more) programs are connected this way, the  construc- 
  441. tion is called a pipeline. 
  442.    A still more complicated example is: 
  443.  
  444.      head  -15  /etc/text  |  tail  -5  | sort  >y 
  445.  
  446. which first extracts 15 lines from the file, then takes the last 5 of these and 
  447. passes them to sort, which sorts them alphabetically (using the ASCII collating 
  448. sequence), and writes the result on the file x.  Try this command, and make  up 
  449. your  own pipelines using these programs and also rev, which reverses the char- 
  450. acters in a line.  The first character becomes the last one and  the  last  one 
  451. becomes the first one (e.g., HORSE becomes ESROH). 
  452.    You can compare two files to see if they are identical using  cmp.   Another 
  453. useful program is comm, which expects two input files, each containing a sorted 
  454. list of items.  The output of comm tells which items occur in  only  the  first 
  455. file  (left-hand  column), occur in only the second file (middle column), or in 
  456. both files (right-hand column).  The output of comm can be displayed,  used  as 
  457. the input of another filter, or redirected to an output file. 
  458.    It is possible to see the output and save it at the same time using  tee  as 
  459. follows: 
  460.  
  461.      head  /etc/text  |  sort  |  tee  x 
  462.  
  463. This pipeline writes the sorted output onto the file x, but also writes  it  on 
  464. standard output (the screen). 
  465.    You can time a command using time: 
  466.  
  467.      time  sleep 5 
  468.  
  469. The sleep command simply waits 5 seconds before returning, and time reports  on 
  470. the  real  time, user time, and system time used to carry out the command.  For 
  471. sleep, the user and system times will usually be 0.0. 
  472.    MINIX   supports   multiprogramming   (sometimes    called    multitasking).  
  473.  
  474. SEC.  1.4                       USING THE SHELL                               9 
  475.  
  476. Multiprogramming  allows  multiple  processes to run simultaneously.  A process 
  477. can be put in the background by appending its command  with  an  ampersand  (&) 
  478. like this: 
  479.  
  480.      sleep 15 & 
  481.  
  482. Notice that after typing a command, the shell will respond with a  number,  the 
  483. process  id  of  the background process just started.  If you change your mind, 
  484. you can terminate a background process using the kill command.  For example, if 
  485. the  previous  command caused the shell to output ``28'' as the process id, the 
  486. command 
  487.  
  488.      kill  28 
  489.  
  490. would terminate process 28.  Process id 0 can be used to  kill  all  background 
  491. processes. 
  492.    You can see how many background processes you have by hitting the F1 key  on 
  493. the  PC  or CTRL-ALT-F1 on the Atari.  As an example of multiple processes, try 
  494. typing: 
  495.      time sleep 60 & time sleep 50 & time sleep 40 & 
  496. This command will start up six background processes:  three  running  time  and 
  497. three  running sleep.  Try killing them off one at a time using kill and hit F1 
  498. on the IBM PC (or CTRL-ALT-F1 on the Atari) each time to see how many are left. 
  499. Needless  to  say,  you  can  start any process off in the background, not just 
  500. sleep. 
  501.    While a complete tutorial on shell programming is beyond the scope  of  this 
  502. manual,  we  will just point out that the shell supplied with the demonstration 
  503. disk is a full Bourne shell.  Consult any book on UNIX to find out  more  about 
  504. using it.  As a simple example, create the following file, compare using mined: 
  505.  
  506.      case $# in 
  507.           0)   echo Compare: You have not supplied any arguments. At least 2 needed. 
  508.                exit 1 
  509.                ;; 
  510.           1)   echo Compare: You have only supplied one argument. At least 2 needed. 
  511.                exit 1 
  512.                ;; 
  513.      esac 
  514.  
  515.      file=$1 
  516.      shift 
  517.      for i 
  518.      do 
  519.            if cmp -s $i $file 2>/dev/null 
  520.               then echo $i is the same as $file 
  521.               else echo $i does not exist or is different from $file 
  522.            fi 
  523.      done 
  524.  
  525. To test this shell script, create a file x  along  with  several  other  files. 
  526.  
  527.  
  528. 10                               INTRODUCTION                          CHAP.  1 
  529.  
  530. Some  of  these  should  be  copies  of  x;  the rest should be different.  For 
  531. example, type: 
  532.  
  533.      cp  /etc/rc  x 
  534.      cp  /etc/text  a 
  535.      cp  x  b 
  536.      cp  /etc/passwd  c 
  537.  
  538. To run your new shell script, type: 
  539.  
  540.      sh  compare  x  a  b  c 
  541.  
  542. The shell script will compare the second, third,  fourth  (and  subsequent,  if 
  543. present)  files  with  the first one, and tell which are the same and which are 
  544. different.  Also try it with no arguments  and  with  one  argument.   In  full 
  545. MINIX, you could make compare executable with chmod.  See Chap. 2 for more pro- 
  546. grams and try them all. 
  547.  
  548.  
  549. 1.5.  PRINTING 
  550.  
  551.    You can print files using lpr.  For example: 
  552.      lpr  /etc/text  & 
  553. will print /etc/text using the centronics printer port.  Note that lpr is not a 
  554. spooler,  so  you cannot start up the next lpr until the first one is finished, 
  555. but by starting it up in the background, as shown,  you  can  do  other  things 
  556. while it is printing. 
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.                                        2 
  575.  
  576.  
  577.  
  578.  
  579.                                  MANUAL PAGES 
  580.  
  581.    This chapter contains the manual ``pages'' for those MINIX programs included 
  582. on  the  demonstration disk.  For each command, its name, syntax, and flags are 
  583. given, as well as at least one example of its usage, and finally a  description 
  584. of what it does.  Although most commands are available in all versions of MINIX 
  585. A few are not.  These commands have square  brackets  in  their  Command  lines 
  586. listing the versions in which they are present. 
  587.    The following conventions are used in the Syntax lines below.  Items printed 
  588. in bold typeface are to be typed exactly as they appear here.  Items printed in 
  589. italics typeface are to be replaced by user-chosen directory names, file names, 
  590. integers, and so on.  Punctuation marks are printed in the roman typeface.  The 
  591. sharp sign (#) is used below to indicate the start of a comment.  The text fol- 
  592. lowing  the  sharp  sign  is  not  part of the command.  It is provided to help 
  593. explain the command. 
  594.  
  595.  
  596.  
  597. 2.1.  MANUAL PAGES 
  598.  
  599. cmp - compare two files 
  600. Command:   cmp - compare two files 
  601. Syntax:    cmp [-ls] file1 file2 
  602. Flags:     -l  Loud mode. Print bytes that differ (in octal) 
  603.            -s  Silent mode.  Print nothing, just return exit status 
  604.  
  605.  
  606.                                       11 
  607.  
  608.  
  609. 12                               MANUAL PAGES                          CHAP.  2 
  610.  
  611. Examples:  cmp file1 file2              # Tell whether the files are the same 
  612.            cmp -l file1 file2           # Print all corresponding bytes that differ 
  613.    Two files are compared.  If they are identical, exit status 0  is  returned. 
  614. If they differ, exit status 1 is returned.  If the files cannot be opened, exit 
  615. status 2 is returned.  If file1 is - , stdin is compared to file2. 
  616.  
  617.  
  618.  
  619. comm - print lines common to two sorted files 
  620. Command:   comm - print lines common to two sorted files 
  621. Syntax:    comm [-123] file1 file2 
  622. Flags:     -1  Suppress column 1 (lines present only in file1) 
  623.            -2  Suppress column 2 (lines present only in file2) 
  624.            -3  Suppress column 3 (lines present in both files) 
  625. Examples:  comm file1 file2             # Print all three columns 
  626.            comm -12 file1 file2         # Print only lines common to both files 
  627.    Two sorted files are read and compared.  A three column listing is produced. 
  628. Files only in file1 are in column 1; files only in file2 are in column 2; files 
  629. common to both files are in column 3.  The file name - means stdin. 
  630.  
  631.  
  632.  
  633. cp - copy file 
  634. Command:   cp - copy file 
  635. Syntax:    cp file1 file2 
  636.            cp file ... directory 
  637. Flags:     (none) 
  638. Examples:  cp oldfile newfile           # Copy oldfile to newfile 
  639.            cp file1 file2 /usr/ast      # Copy two files to a directory 
  640.    Cp copies one file to another, or copies one or more files to  a  directory. 
  641. A file cannot be copied to itself.  Cp is much faster than cat or dd and should 
  642. be used for copying when it is applicable. 
  643.  
  644.  
  645.  
  646. date - print or set the date and time 
  647. Command:   date - print or set the date and time 
  648. Syntax:    date [-q [[MMDDYY]hhmm[ss]] 
  649. Flags:     -q  Read the date from stdin 
  650. Examples:  date                         # Print the date and time 
  651.            date 0221921610              # Set date to Feb 21, 1992 at 4:10 p.m. 
  652.    Without an argument, date prints the current date and time.  With  an  argu- 
  653. ment,  it  sets  the date and time.  MMDDYY refers to the month, day, and year; 
  654. hhmmss refers to the hour, minute and second.  Each of the six fields  must  be 
  655. exactly two digits, no more and no less. 
  656.  
  657.  
  658. SEC.  2.1                        MANUAL PAGES                                13 
  659.  
  660. df - report on free disk space and i-nodes 
  661. Command:   df - report on free disk space and i-nodes 
  662. Syntax:    df special ... 
  663. Flags:     (none) 
  664. Examples:  df /dev/ram                  # Report on free RAM disk space 
  665.            df /dev/fd0 /dev/fd1         # Report on diskette space 
  666.            df                           # Report on all mounted devices 
  667.    The amount of disk space and number  of  i-nodes,  both  free  and  used  is 
  668. reported.   If  no  argument  is  given,  df reports on the root device and all 
  669. mounted file systems. 
  670.  
  671.  
  672.  
  673. echo - print the arguments 
  674. Command:   echo - print the arguments 
  675. Syntax:    echo [-n] argument ... 
  676. Flags:     -n  No line feed is output when done 
  677. Examples:  echo Start Phase 1           # ``Start Phase 1'' is printed 
  678.            echo -n Hello                # ``Hello'' is printed without a line feed 
  679.    Echo writes its arguments to standard output.  They are separated by  blanks 
  680. and  terminated  with  a  line feed unless -n is present.  This command is used 
  681. mostly in shell scripts. 
  682.  
  683.  
  684.  
  685. head - print the first few lines of a file 
  686. Command:   head - print the first few lines of a file 
  687. Syntax:    head [-n] [file] ... 
  688. Flags:     -n  How many lines to print 
  689. Examples:  head -6                      # Print first 6 lines of stdin 
  690.            head -1 file1 file2          # Print first line of two files 
  691.    The first few lines of one or more files are printed.  The default count  is 
  692. 10 lines.  The default file is stdin. 
  693.  
  694.  
  695.  
  696. kill - send a signal to a process 
  697. Command:   kill - send a signal to a process 
  698. Syntax:    kill [-n] process 
  699. Flags:     -n  Signal number to send 
  700. Examples:  kill 35                      # Send signal 15 to process 35 
  701.            kill -9 40                   # Send signal 9 to process 40 
  702.            kill -2 0                    # Send signal 2 to whole process group 
  703.    A signal is sent to a given process.  By  default  signal  15  (SIGTERM)  is 
  704. sent.  Process 0 means all the processes in the sender's process group. 
  705.  
  706.  
  707.  
  708.  
  709.  
  710. 14                               MANUAL PAGES                          CHAP.  2 
  711.  
  712. login - log into the computer 
  713. Command:   login - log into the computer 
  714. Syntax:    login [user] 
  715. Flags:     (none) 
  716. Example:   login ast                    # Login as ast 
  717.    Login allows a logged in user to login as someone else without first logging 
  718. out.  If a password is needed, login will prompt for it. 
  719.  
  720.  
  721.  
  722. lpr - copy a file to the line printer 
  723. Command:   lpr - copy a file to the line printer 
  724. Syntax:    lpr [file] ... 
  725. Flags:     (none) 
  726. Examples:  lpr file &                   # Print file on the line printer 
  727.            pr file | lpr &              # Print stdin (pr's output) 
  728.    Each argument is interpreted as a file to be printed.  Lpr copies each  file 
  729. to  /dev/lp,  without  spooling.  It inserts carriage returns and expands tabs. 
  730. Only one lpr at a time may be running. 
  731.  
  732.  
  733.  
  734. ls - list the contents of a directory 
  735. Command:   ls - list the contents of a directory 
  736. Syntax:    ls [-ACFRadfgilrstu] [name] ... 
  737. Flags:     -A  All entries are listed, except . and .. 
  738.            -C  Multicolumn listing 
  739.            -F  Put / after directory names 
  740.            -R  Recursively list subdirectories 
  741.            -a  All entries are listed, even . and .. 
  742.            -d  Do not list contents of directories 
  743.            -f  List argument as unsorted directory 
  744.            -g  Group id given instead of user id 
  745.            -i  I-node number printed in first column 
  746.            -l  Long listing: mode, links, owner, size and time 
  747.            -r  Reverse the sort order 
  748.            -s  Give size in blocks (including indirect blocks) 
  749.            -t  Sort by time, latest first 
  750.            -u  Use last usage time instead of modification time 
  751. Examples:  ls -l                        # List files in working directory 
  752.            ls -lis                      # List with i-nodes and sizes 
  753.    For each file argument, list it.  For each directory argument, list its con- 
  754. tents,  unless  -d is present.  When no argument is present, the working direc- 
  755. tory is listed. 
  756.  
  757.  
  758. SEC.  2.1                        MANUAL PAGES                                15 
  759.  
  760. mined - MINIX editor 
  761. Command:   mined - MINIX editor 
  762. Syntax:    mined [file] 
  763. Flags:     (none) 
  764. Examples:  mined /user/ast/book.3       # Edit an existing file 
  765.            mined                        # Call editor to create a new file 
  766.            ls -l | mined                # Use mined as a pager to inspect listing 
  767.    Mined (pronounced min-ed) is a simple full-screen editor.   When  editing  a 
  768. file,  it  holds the file in memory, thus speeding up editing, but limiting the 
  769. editor to files of up to about 35K.  Larger files must first be cut into pieces 
  770. by  split.   Lines may be arbitrarily long.  Output from a command may be piped 
  771. into mined so it can be viewed without scrolling off the screen, that is, mined 
  772. can be used as a pager. 
  773.    At any instant, a window of 24 lines is visible on the screen.  The  current 
  774. position  in the file is shown by the cursor.  Ordinary characters typed in are 
  775. inserted at the cursor.  Control characters and keys on the numeric keypad  (at 
  776. the  right-hand  side  of the keyboard) are used to move the cursor and perform 
  777. other functions. 
  778.    Commands exist to move forward and backward a word, and delete words  either 
  779. in  front  of the cursor or behind it.  A word in this context is a sequence of 
  780. characters delimited on both ends by white space (space, tab, line feed,  start 
  781. of  file, or end of file).  The commands for deleting characters and words also 
  782. work on line feeds, making it possible to join two consecutive lines by  delet- 
  783. ing the line feed between them. 
  784.    The editor maintains one save buffer (not displayed).  Commands are  present 
  785. to  move  text from the file to the buffer, from the buffer to the file, and to 
  786. write the buffer onto a new file.  If the edited text cannot be written out due 
  787. to  a  full  disk,  it may still be possible to copy the whole text to the save 
  788. buffer and then write it to a different file on a different disk  with  CTRL-Q. 
  789. It  may  also be possible to escape from the editor with CTRL-S and remove some 
  790. files. 
  791.    Some of the commands prompt for  arguments  (file  names,  search  patterns, 
  792. etc.).   All commands that might result in loss of the file being edited prompt 
  793. to ask for confirmation. 
  794.    A key (command or ordinary character) can be repeated n times by typing  ESC 
  795. n key where ESC is the ``escape'' key. 
  796.    Forward and backward searching requires a regular expression as  the  search 
  797. pattern.   Regular expressions follow the same rules as in the UNIX editor, ed. 
  798. These rules can be stated as: 
  799.  
  800.    1. Any displayable character matches itself. 
  801.    2. . (period) matches any character except line feed. 
  802.    3. ^ (circumflex) matches the start of the line. 
  803.    4. $ (dollar sign) matches the end of the line. 
  804.    5. \c matches the character c (including period, circumflex, etc). 
  805.    6. [string] matches any of the characters in the string. 
  806.  
  807.  
  808. 16                               MANUAL PAGES                          CHAP.  2 
  809.  
  810.    7. [^string] matches any of the characters except those in the string. 
  811.    8. [x-y] matches any characters between x and y (e.g., [a-z]). 
  812.    9. Pattern* matches any number of occurrences of pattern. 
  813.  
  814. Some examples of regular expressions are: 
  815.  
  816.     The boy  matches the string ``The boy'' 
  817.     ^$       matches any empty line. 
  818.     ^.$      matches any line containing exactly 1 character 
  819.     ^A.*\.$  matches any line starting with an A, ending with a period. 
  820.     ^[A-Z]*$ matches any line containing only capital letters (or empty). 
  821.     [A-Z0-9] matches any line containing either a capital letter or a digit. 
  822.     .*X      matches any line ending in ``X'' 
  823.     A.*B     matches any line containing an ``A'' and then a ``B'' 
  824.  
  825.    Control characters cannot be entered into  a  file  simply  by  typing  them 
  826. because all of them are editor commands.  To enter a control character, depress 
  827. the ALT key, and then while holding it down, hit the ESC key.  Release both ALT 
  828. and  ESC  and  type the control character.  Control characters are displayed in 
  829. reverse video. 
  830.    The mined commands are as follows. 
  831.  
  832. CURSOR MOTION 
  833.   arrows    Move the cursor in the indicated direction 
  834.   CTRL-A    Move cursor to start of current line 
  835.   CTRL-Z    Move cursor to end of current line 
  836.   CTRL-^    Move cursor to top of screen 
  837.   CTRL-_    Move cursor to end of screen 
  838.   CTRL-F    Move cursor forward to start of next word 
  839.   CTRL-B    Move cursor backward to start of previous word 
  840.  
  841. SCREEN MOTION 
  842.   Home key  Move to first character of the file 
  843.   End key   Move to last character of the file 
  844.   PgUp key  Scroll window up 23 lines (closer to start of the file) 
  845.   PgDn key  Scroll window down 23 lines (closer to end of the file) 
  846.   CTRL-U    Scroll window up 1 line 
  847.   CTRL-D    Scroll window down 1 line 
  848.  
  849. MODIFYING TEXT 
  850.   Del key   Delete the character under the cursor 
  851.   Backspace Delete the character to left of the cursor 
  852.   CTRL-N    Delete the next word 
  853.   CTRL-P    Delete the previous word 
  854.   CTRL-T    Delete tail of line (all characters from cursor to end of line) 
  855.   CTRL-O    Open up the line (insert line feed and back up) 
  856.   CTRL-G    Get and insert a file at the cursor position 
  857.  
  858.  
  859. SEC.  2.1                        MANUAL PAGES                                17 
  860.  
  861. BUFFER OPERATIONS 
  862.   CTRL-@    Set mark at current position for use with CTRL-C and CTRL-K 
  863.   CTRL-C    Copy the text between the mark and the cursor into the buffer 
  864.   CTRL-K    Delete text between mark and cursor; also copy it to the buffer 
  865.   CTRL-Y    Yank contents of the buffer out and insert it at the cursor 
  866.   CTRL-Q    Write the contents of the buffer onto a file 
  867.  
  868. MISCELLANEOUS 
  869.   numeric + Search forward (prompts for regular expression) 
  870.   numeric - Search backward (prompts for regular expression) 
  871.   numeric 5 Display the file status 
  872.   CTRL-]    Go to specific line 
  873.   CTRL-R    Global replace pattern with string (from cursor to end) 
  874.   CTRL-L    Line replace pattern with string 
  875.   CTRL-W    Write the edited file back to the disk 
  876.   CTRL-X    Exit the editor 
  877.   CTRL-S    Fork off a shell (use CTRL-D to get back to the editor) 
  878.   CTRL-\    Abort whatever the editor was doing and wait for command 
  879.   CTRL-E    Erase screen and redraw it 
  880.   CTRL-V    Visit (edit) a new file 
  881.  
  882.    The key bindings on the Atari ST and  Amiga  are  slightly  different.   The 
  883. table  below  summarizes the mined commands with the corresponding ST keys, and 
  884. the PC keys if they differ. 
  885.  
  886.                ________________________________________________ 
  887.                 CURSOR MOTION          ST key       PC key 
  888.                ________________________________________________ 
  889.                 up,down,left,right     arrows 
  890.                 start of line          CTRL-A 
  891.                 end of line            CTRL-Z 
  892.                 top of screen          CTRL-^ 
  893.                 end of screen          CTRL-_ 
  894.                 next word              CTRL-F 
  895.                 previous word          CTRL-B 
  896.                ________________________________________________ 
  897.                                                                 
  898.  
  899.                ________________________________________________ 
  900.                 SCREEN MOTION          ST key       PC key 
  901.                ________________________________________________ 
  902.                 first char of file     Home 
  903.                 last char of file      F6           End 
  904.                 scroll window up       F4           PgUp 
  905.                 scroll window down     F3           PgDn 
  906.                 scroll line up         CTRL-U 
  907.                 scroll line down       CTRL-D 
  908.                ________________________________________________ 
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917. 18                               MANUAL PAGES                          CHAP.  2 
  918.  
  919.                ________________________________________________ 
  920.                 MODIFYING TEXT         ST key       PC key 
  921.                ________________________________________________ 
  922.                 delete this char       Delete 
  923.                 delete previous char   Backspace 
  924.                 delete next word       CTRL-N 
  925.                 delete previous word   CTRL-P 
  926.                 delete tail of line    CTRL-T 
  927.                 open up line           CTRL-O 
  928.                 get file at cursor     CTRL-G 
  929.                ________________________________________________ 
  930.  
  931.  
  932.                ________________________________________________ 
  933.                 MISCELLANEOUS          ST key       PC key 
  934.                ________________________________________________ 
  935.                 search forward         F1           numeric + 
  936.                 search backward        F2           numeric - 
  937.                 file status            F5           numeric 5 
  938.                 repeat                 Esc 
  939.                 goto line              CTRL-] 
  940.                 global replace         CTRL-R 
  941.                 line replace           CTRL-L 
  942.                 write file             CTRL-W 
  943.                 exit                   CTRL-X 
  944.                 fork shell             CTRL-S 
  945.                 abort                  CTRL-\ 
  946.                 redraw                 CTRL-E 
  947.                 new file               CTRL-V 
  948.                 escape next char       F8           ALT-ESC 
  949.                ________________________________________________ 
  950.  
  951.  
  952.                ________________________________________________ 
  953.                 BUFFER OPERATIONS      ST key       PC key 
  954.                ________________________________________________ 
  955.                 set mark               F7           CTRL-@ 
  956.                 copy to buffer         CTRL-C 
  957.                 delete to buffer       CTRL-K 
  958.                 insert buffer          CTRL-Y 
  959.                 write buffer to file   CTRL-Q 
  960.                ________________________________________________ 
  961.  
  962.  
  963.                                                                
  964. Command:   mkdir - make a directory 
  965. Syntax:    mkdir directory ... 
  966. Flags:     (none) 
  967. Examples:  mkdir dir                    # Create dir in the current directory 
  968.            mkdir /user/ast/dir          # Create the specified directory 
  969.    The specified directory or directories are created and initialized. 
  970.  
  971.  
  972. SEC.  2.1                        MANUAL PAGES                                19 
  973.  
  974. mkfs - make a file system 
  975. Command:   mkfs - make a file system 
  976. Syntax:    mkfs [-Ldot] special prototype 
  977. Flags:     -L  Make a listing on standard output 
  978.            -d  Use mod time of mkfs binary for all files 
  979.            -o  Use a drive other than 0 or 1 (safety precaution) 
  980.            -t  Do not test if file system fits on the medium 
  981. Examples:  mkfs /dev/fd1 proto          # Make a file system on /dev/fd1 
  982.            mkfs /dev/fd1 360            # Make empty 360 block file system 
  983.    Mkfs builds a file system and copies specified files to it.   The  prototype 
  984. file  tells  which  directories and files to copy to it.  If the prototype file 
  985. cannot be opened, and its name is just a string of digits, an empty file system 
  986. will be made with the specified number of blocks.  A sample prototype file fol- 
  987. lows.  The text following the # sign in the example below is comment.  In  real 
  988. prototype files, comments are not allowed. 
  989.  
  990.   boot                        # boot block file (ignored) 
  991.   360 63                           # blocks and i-nodes 
  992.   d--755 1 1                       # root directory 
  993.      bin   d--755 2 1         # bin dir: mode (755), uid (2), gid (1) 
  994.        sh  ---755 2 1 /user/bin/shell   # shell has mode rwxr-xr-x 
  995.        mv  -u-755 2 1 /user/bin/mv # u = SETUID bit 
  996.        login                  -ug755 2 1 /user/bin/login# SETUID and SETGID 
  997.      $                        # end of /bin 
  998.      dev   d--755 2 1         # special files: tty (char), fd0 (block) 
  999.        tty c--777 2 1 4 0     # uid=2, gid=1, major=4, minor=0 
  1000.        fd0 b--644 2 1 2 0 360 # uid, gid, major, minor, blocks 
  1001.      $                        # end of /dev 
  1002.      user  d--755 12 1        # user dir: mode (755), uid (12), gid (1) 
  1003.        ast d--755 12 1        # /user/ast 
  1004.        $                      # /user/ast is empty 
  1005.      $                        # end of /user 
  1006.   $                           # end of root directory 
  1007.  
  1008. The first entry on each line (except the first 3 and the $  lines,  which  ter- 
  1009. minate  directories) is the name the file or directory will get on the new file 
  1010. system. Next comes its mode, with the first character being  -dbc  for  regular 
  1011. files,  directories,  block  special files and character special files, respec- 
  1012. tively.  The next two characters are used to  specify  the  SETUID  and  SETGID 
  1013. bits,  as  shown above.  The last three characters of the mode are the rwx pro- 
  1014. tection bits. 
  1015.    Following the mode are the uid and gid.  For special files,  the  major  and 
  1016. minor  devices are needed.  The size in blocks must also be specified for block 
  1017. special files (the MINIX block size is 1K; this can only be changed by changing 
  1018. BLOCK_SIZE and then recompiling the operating system). 
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024. 20                               MANUAL PAGES                          CHAP.  2 
  1025.  
  1026. mount - mount a file system 
  1027. Command:   mount - mount a file system 
  1028. Syntax:    /etc/mount special file [-r] 
  1029. Flags:     -r  File system is mounted read-only 
  1030. Example:   /etc/mount /dev/fd1 /user    # Mount diskette 1 on /user 
  1031.    The file system contained on the special file is mounted on  file.   In  the 
  1032. example above, the root directory of the file system in drive 1 can be accessed 
  1033. as /user after the mount.  When the file system is no longer needed, it must be 
  1034. unmounted before being removed from the drive. 
  1035.  
  1036.  
  1037.  
  1038. pwd - print working directory 
  1039. Command:   pwd - print working directory 
  1040. Syntax:    pwd 
  1041. Flags:     (none) 
  1042. Example:   pwd                          # Print the name of the working directory 
  1043.    The full path name of the current working directory is printed. 
  1044.  
  1045.  
  1046.  
  1047. rev - reverse the characters on each line of a file 
  1048. Command:   rev - reverse the characters on each line of a file 
  1049. Syntax:    rev [file] ... 
  1050. Flags:     (none) 
  1051. Example:   rev file                     # Reverse each line 
  1052.    Each file is copied to standard output with all the characters of each  line 
  1053. reversed, last one first and first one last. 
  1054.  
  1055.  
  1056.  
  1057. rm - remove a file 
  1058. Command:   rm - remove a file 
  1059. Syntax:    rm [-fir] name ... 
  1060. Flags:     -f  Forced remove: no questions asked 
  1061.            -i  Interactive remove: ask before removing 
  1062.            -r  Remove directories too 
  1063. Examples:  rm file                      # Remove file 
  1064.            rm -i *.c                    # Remove .c files, asking about each 
  1065.    Rm removes one or more files.  If a file has no write  permission,  rm  asks 
  1066. for  permission (type ``y'' or ``n'') unless -f is specified.  If the file is a 
  1067. directory, it will be recursively descended and removed if and only if  the  -r 
  1068. flag is present. 
  1069.  
  1070.  
  1071.  
  1072. rmdir - remove a directory 
  1073. Command:   rmdir - remove a directory 
  1074. Syntax:    rmdir directory ... 
  1075.  
  1076.  
  1077. SEC.  2.1                        MANUAL PAGES                                21 
  1078.  
  1079. Flags:     (none) 
  1080. Examples:  rmdir /user/ast/foobar       # Remove directory foobar 
  1081.            rmdir /user/ast/f*           # Remove 0 or more directories 
  1082.    The specified directories are removed.  Ordinary files are not removed.  The 
  1083. directories must be empty. 
  1084.  
  1085.  
  1086.  
  1087. sh - shell 
  1088. Command:   sh - shell 
  1089. Syntax:    sh [file] 
  1090. Flags:     (none) 
  1091. Example:   sh < script                  # Run a shell script 
  1092.    Sh is the shell.  It permits redirection of input and output,  pipes,  magic 
  1093. characters,  background processes, shell scripts and most of the other features 
  1094. of the V7 (Bourne) shell.  A few of the more common commands are listed below: 
  1095.  
  1096.   date                # Regular command 
  1097.   sort <file          # Redirect stdin 
  1098.   sort <file1  >file2 # Redirect stdin and stdout 
  1099.   cc file.c  2>error  # Redirect stderr 
  1100.   a.out >f  2>&1      # Combine standard output and standard error 
  1101.   sort <file1  >>file2     # Append output to file2 
  1102.   sort <file1  >file2 &    # Background job 
  1103.   (ls -l; a.out) &    # Run two background commands sequentially 
  1104.   sort <file | wc     # Two-process pipeline 
  1105.   sort <f | uniq | wc # Three-process pipeline 
  1106.   ls -l *.c           # List all files ending in .c 
  1107.   ls -l [a-c]*        # List all files beginning with a, b, or c 
  1108.   ls -l ?             # List all one-character file names 
  1109.   ls \?               # List the file whose name is question mark 
  1110.   ls '???'            # List the file whose name is three question marks 
  1111.   v=/usr/ast          # Set shell variable v 
  1112.   ls -l $v            # Use shell variable v 
  1113.   PS1='Hi! '          # Change the primary prompt to Hi! 
  1114.   PS2='More: '        # Change the secondary prompt to More: 
  1115.   ls -l $HOME         # List the home directory 
  1116.   echo $PATH          # Echo the search path 
  1117.   if ... then ... else ... fi   # If statement 
  1118.   for ... do ... done # Iterate over argument list 
  1119.   while ... do ... done    # Repeat while condition holds 
  1120.   case ... in ...  esac    # Select clause based on condition 
  1121.   echo $?             # Echo exit status of previous command 
  1122.   echo $$             # Echo shell's pid 
  1123.   echo $#             # Echo number of parameters (shell script) 
  1124.   echo $2             # Echo second parameter (shell script) 
  1125.   echo $*             # Echo all parameters (shell script) 
  1126.  
  1127.  
  1128.  
  1129.  
  1130. 22                               MANUAL PAGES                          CHAP.  2 
  1131.  
  1132. sleep - suspend execution for a given number of seconds 
  1133. Command:   sleep - suspend execution for a given number of seconds 
  1134. Syntax:    sleep seconds 
  1135. Flags:     (none) 
  1136. Example:   sleep 10                     # Suspend execution for 10 sec. 
  1137.    The caller is suspended for the indicated number of seconds. 
  1138.  
  1139.  
  1140.  
  1141. sort - sort a file of ASCII lines 
  1142. Command:   sort - sort a file of ASCII lines 
  1143. Syntax:    sort [-bcdfimnru] [-tc]  [-o name] [+pos1] [-pos2] file ... 
  1144. Flags:     -b  Skip leading blanks when making comparisons 
  1145.            -c  Check to see if a file is sorted 
  1146.            -d  Dictionary order: ignore punctuation 
  1147.            -f  Fold upper case onto lower case 
  1148.            -i  Ignore nonASCII characters 
  1149.            -m  Merge presorted files 
  1150.            -n  Numeric sort order 
  1151.            -o  Next argument is output file 
  1152.            -r  Reverse the sort order 
  1153.            -t  Following character is field separator 
  1154.            -u  Unique mode (delete duplicate lines) 
  1155. Examples:  sort -nr file                # Sort keys numerically, reversed 
  1156.            sort +2 -4 file              # Sort using fields 2 and 3 as key 
  1157.            sort +2 -t: -o out           # Field separator is : 
  1158.            sort +.3 -.6                 # Characters 3 through 5 form the key 
  1159.    Sort sorts one or more files.  If no files are specified, stdin  is  sorted. 
  1160. Output  is  written  on  standard  output, unless -o is specified.  The options 
  1161. +pos1 -pos2 use only fields pos1 up to but not including pos2 as the sort  key, 
  1162. where  a field is a string of characters delimited by spaces and tabs, unless a 
  1163. different field delimiter is specified with -t.  Both pos1 and  pos2  have  the 
  1164. form  m.n  where m tells the number of fields and n tells the number of charac- 
  1165. ters.  Either m or n may be omitted. 
  1166.  
  1167.  
  1168.  
  1169. sync - flush the cache to disk 
  1170. Command:   sync - flush the cache to disk 
  1171. Syntax:    sync 
  1172. Flags:     (none) 
  1173. Example:   sync                         # Write out all modified cache blocks 
  1174.    MINIX maintains a cache of recently used  disk  blocks.   The  sync  command 
  1175. writes  any  modified  cache blocks back to the disk.  This is essential before 
  1176. stopping the system, and should be done before running any a.out  program  that 
  1177. might crash. 
  1178.  
  1179.  
  1180.  
  1181. SEC.  2.1                        MANUAL PAGES                                23 
  1182.  
  1183. tail - print the last few lines of a file 
  1184. Command:   tail - print the last few lines of a file 
  1185. Syntax:    tail  [-cl] [-n] [file] ... 
  1186. Flags:     -c  The count refers to characters 
  1187.            -l  The count refers to lines 
  1188.            -n  How many characters or lines to print 
  1189. Examples:  tail -6                      # Print last 6 lines of stdin 
  1190.            tail -1 file1 file2          # Print last line of two files 
  1191.    The last few lines of one or more files are printed.  The default  count  is 
  1192. 10 lines.  The default file is stdin. 
  1193.  
  1194.  
  1195.  
  1196. tee - divert stdin to a file 
  1197. Command:   tee - divert stdin to a file 
  1198. Syntax:    tee [-ai] file ... 
  1199. Flags:     -a  Append to the files, rather than overwriting 
  1200.            -i  Ignore interrupts 
  1201. Examples:  cat file1 file2 | tee x      # Save and display two files 
  1202.            pr file | tee x | lpr        # Save the output of pr on x 
  1203.    Tee copies stdin to standard output.  It also makes copies on all the  files 
  1204. listed as arguments. 
  1205.  
  1206.  
  1207.  
  1208. time - report how long a command takes 
  1209. Command:   time - report how long a command takes 
  1210. Syntax:    time command 
  1211. Flags:     (none) 
  1212. Examples:  time a.out                   # Report how long a.out takes 
  1213.            time ls -l *.c               # Report how long ls takes 
  1214.    The command is executed and the real time, user time, and  system  time  (in 
  1215. hours, minutes, and seconds) are printed.  Shell scripts cannot be timed. 
  1216.  
  1217.  
  1218.  
  1219. true - exit with the value true 
  1220. Command:   true - exit with the value true 
  1221. Syntax:    true 
  1222. Flags:     (none) 
  1223. Example:   while true                   # List the directory until DEL is hit 
  1224.            do ls -l 
  1225.            done 
  1226.    This command returns the value true.  It is used for shell programming.  The 
  1227. program is in reality not a program at all.  It is the null file. 
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233. 24                               MANUAL PAGES                          CHAP.  2 
  1234.  
  1235. umount - unmount a mounted file system 
  1236. Command:   umount - unmount a mounted file system 
  1237. Syntax:    /etc/umount special 
  1238. Flags:     (none) 
  1239. Example:   /etc/umount /dev/fd1         # Unmount diskette 1 
  1240.    A mounted file system is unmounted after the cache has been flushed to disk. 
  1241. A  diskette  should never be removed while it is mounted.  If this happens, and 
  1242. is discovered before another diskette is inserted,  the  original  one  can  be 
  1243. replaced  without  harm.   Attempts  to  unmount  a file system holding working 
  1244. directories or open files will be rejected with a ``device busy'' message. 
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.                                        3 
  1257.  
  1258.  
  1259.  
  1260.  
  1261.                          DESCRIPTION OF FULL MINIX 1.5 
  1262.  
  1263.    This chapter gives a summary of what the full MINIX  distribution  contains. 
  1264. The  first  section reproduces the table of contents of the manual.  The second 
  1265. section lists and briefly describes most of the programs provided  with  MINIX. 
  1266. The  third  section  names  most of the library routines that are standard with 
  1267. MINIX. 
  1268.  
  1269.  
  1270. 3.1.  MINIX REFERENCE MANUAL TABLE OF CONTENTS 
  1271.  
  1272.    The Table of Contents of the MINIX Reference Manual is  listed  below.   The 
  1273. manual  is  680 pages long, which includes a cross-referenced listing of the of 
  1274. the operating system source code (in C). 
  1275.  
  1276. 1   INTRODUCTION   1 
  1277.     1.1 HISTORY OF UNIX   1 
  1278.     1.2 HISTORY OF MINIX   3 
  1279.     1.3 STRUCTURE OF THIS MANUAL   5 
  1280.  
  1281. 2   INSTALLING MINIX ON THE IBM PC, XT, AT, 386, AND PS/2   6 
  1282.     2.1 MINIX HARDWARE REQUIREMENTS   6 
  1283.     2.2 HOW TO START MINIX   7 
  1284.     2.3 HOW TO INSTALL MINIX ON A HARD DISK   10 
  1285.     2.4 TESTING MINIX   20 
  1286.     2.5 TROUBLESHOOTING   22 
  1287.  
  1288.  
  1289. 26                       DESCRIPTION OF FULL MINIX 1.5                 CHAP.  3 
  1290.  
  1291. 3   INSTALLING MINIX ON THE ATARI ST   24 
  1292.     3.1 THE MINIX-ST DISTRIBUTION   25 
  1293.     3.2 NATIONAL KEYBOARDS   26 
  1294.     3.3 BOOTING MINIX-ST   27 
  1295.     3.4 INCREASING THE SIZE OF YOUR RAM DISK   30 
  1296.     3.5 ADAPTING PROGRAMS TO USE EXTRA RAM   31 
  1297.     3.6 USING SINGLE-SIDED DISKETTES   32 
  1298.     3.7 USING A HARD DISK   33 
  1299.     3.8 USING A MEGA ST   40 
  1300.     3.9 USING A DISK CONTROLLER BASED CLOCK   40 
  1301.     3.10 BOOT PROCEDURE OPTIONS   41 
  1302.     3.11 UNPACKING THE SOURCES   42 
  1303.     3.12 THE TOS TOOLS   43 
  1304.     3.13 TROUBLESHOOTING   45 
  1305.  
  1306. 4   INSTALLING MINIX ON THE COMMODORE AMIGA   51 
  1307.     4.1 MINIX HARDWARE REQUIREMENTS   51 
  1308.     4.2 HOW TO START MINIX   52 
  1309.     4.3 A MORE DETAILED LOOK   54 
  1310.     4.4 TROUBLESHOOTING   58 
  1311.  
  1312. 5   INSTALLING MINIX ON THE APPLE MACINTOSH   59 
  1313.     5.1 MACMINIX HARDWARE REQUIREMENTS   59 
  1314.     5.2 THE MACMINIX DISTRIBUTION   59 
  1315.     5.3 NATIONAL KEYBOARDS   60 
  1316.     5.4 BOOTING MACMINIX   60 
  1317.     5.5 INCREASING THE SIZE OF YOUR RAM DISK   63 
  1318.     5.6 ADAPTING PROGRAMS TO USE EXTRA RAM   64 
  1319.     5.7 USING A HARD DISK   65 
  1320.     5.8 UNPACKING THE SOURCES   69 
  1321.     5.9 THE MENUS   70 
  1322.     5.10 SETTING CONFIGURATION OPTIONS   71 
  1323.     5.11 MACINTOSH SYSTEM CALLS   72 
  1324.     5.12 RUNNING MACMINIX WITH MULTIFINDER   72 
  1325.     5.13 TROUBLESHOOTING   73 
  1326.  
  1327. 6   USING MINIX   74 
  1328.     6.1 MAJOR COMPONENTS OF MINIX   74 
  1329.     6.2 PROCESSES AND FILES IN MINIX   79 
  1330.     6.3 A TOUR THROUGH THE MINIX FILE SYSTEM   84 
  1331.     6.4 HELPFUL HINTS   88 
  1332.     6.5 SYSTEM ADMINISTRATION   93 
  1333.  
  1334. 7   RECOMPILING MINIX   97 
  1335.     7.1 REBUILDING MINIX ON AN IBM PC   97 
  1336.     7.2 REBUILDING MINIX ON AN ATARI ST   103 
  1337.     7.3 REBUILDING MINIX ON A COMMODORE AMIGA   109 
  1338.     7.4 REBUILDING MINIX ON AN APPLE MACINTOSH   109 
  1339.  
  1340. 8   MANUAL PAGES   115 
  1341.  
  1342.  
  1343.  
  1344. SEC.  3.2          MINIX REFERENCE MANUAL TABLE OF CONTENTS                  27 
  1345.  
  1346. 9   EXTENDED MANUAL PAGES   189 
  1347.     9.1 ASLD-ASSEMBLER-LOADER [IBM]   189 
  1348.     9.2 BAWK-BASIC AWK   198 
  1349.     9.3 DE-DISK EDITOR   202 
  1350.     9.4 DIS88-DISASSEMBLER FOR THE 8088 [IBM]   207 
  1351.     9.5 ELLE-FULL-SCREEN EDITOR   208 
  1352.     9.6 ELVIS-A CLONE OF THE BERKELEY VI EDITOR   216 
  1353.     9.7 IC-INTEGER CALCULATOR   236 
  1354.     9.8 INDENT-INDENT AND FORMAT C PROGRAMS   239 
  1355.     9.9 KERMIT-A FILE TRANSFER PROGRAM   243 
  1356.     9.10 M4-MACRO PROCESSOR   246 
  1357.     9.11 MDB-MINIX DEBUGGER [68000]   249 
  1358.     9.12 MINED-A SIMPLE SCREEN EDITOR   253 
  1359.     9.13 NROFF-A TEXT PROCESSOR   257 
  1360.     9.14 PATCH-A PROGRAM FOR APPLYING DIFFS   266 
  1361.     9.15 ZMODEM-FILE TRANSFER PROGRAM   269 
  1362.  
  1363. 10  SYSTEM CALLS   274 
  1364.     10.1 INTRODUCTION TO SYSTEM CALLS   274 
  1365.     10.2 LIST OF MINIX SYSTEM CALLS   275 
  1366.  
  1367. 11  NETWORKING   277 
  1368.     11.1 INTRODUCTION   277 
  1369.     11.2 OBJECTS   279 
  1370.     11.3 OVERVIEW OF TRANSACTIONS   281 
  1371.     11.4 TRANSACTION PRIMITIVES   282 
  1372.     11.5 SERVER STRUCTURE   286 
  1373.     11.6 CLIENT STRUCTURE   287 
  1374.     11.7 SIGNAL HANDLING   287 
  1375.     11.8 IMPLEMENTATION OF TRANSACTIONS IN MINIX   288 
  1376.     11.9 COMPILING THE SYSTEM   289 
  1377.     11.10 HOW TO INSTALL AMOEBA   289 
  1378.     11.11 NETWORKING UTILITIES   290 
  1379.     11.12 REMOTE SHELL   290 
  1380.     11.13 SHERVERS   292 
  1381.     11.14 MASTERS   292 
  1382.     11.15 FILE TRANSFER   293 
  1383.     11.16 REMOTE PIPES   293 
  1384.     11.17 THE ETHERNET INTERFACE   293 
  1385.  
  1386. A   MINIX SOURCE CODE LISTING   296 
  1387.  
  1388. B   CROSS REFERENCE MAP   637 
  1389.  
  1390.  
  1391. 3.2.  PARTIAL LIST OF PROGRAMS SUPPLIED WITH MINIX 
  1392.  
  1393.    Below is a list of programs that are supplied with MINIX.  Those lines  that 
  1394. have  [IBM],  [68000],  or  another machine type only apply to the machine type 
  1395. specified in the square brackets.  The complete source code of all  these  pro- 
  1396. grams,  except for elle and the C compiler are part of the standard MINIX pack- 
  1397. age. 
  1398.  
  1399.  
  1400. 28                       DESCRIPTION OF FULL MINIX 1.5                 CHAP.  3 
  1401.  
  1402. animals - twenty-questions type guessing game about animals 
  1403. anm - print name list [68000] 
  1404. aoutdump - display the contents of an object file [68000] 
  1405. ar - archiver 
  1406. as - MC68000 assembler [68000] 
  1407. ascii - strip all the pure ASCII lines from a file 
  1408. asize - report the size of an object file [68000] 
  1409. asld - assembler-loader [IBM] 
  1410. ast - add symbol table to executable file [IBM] 
  1411. astrip - remove symbols [68000] 
  1412. at - execute commands at a later time 
  1413. backup - backup files 
  1414. badblocks - put a list of bad blocks in a file 
  1415. banner - print a banner 
  1416. basename - strip off file prefixes and suffixes 
  1417. bawk - pattern matching language 
  1418. btoa - binary to ascii conversion 
  1419. cal - print a calendar 
  1420. cat - concatenate files and write them to stdout 
  1421. cc - C compiler 
  1422. cdiff - context diff 
  1423. cgrep - grep and display context 
  1424. chgrp - change group 
  1425. chmem - change memory allocation 
  1426. chmod - change access mode for files 
  1427. chown - change owner 
  1428. clr - clear the screen 
  1429. cmp - compare two files 
  1430. comm - print lines common to two sorted files 
  1431. compress - compress a file using modified Lempel-Ziv coding 
  1432. cp - copy file 
  1433. cpdir - copy a directory and its subdirectories 
  1434. crc - print the checksum of the file data 
  1435. cron - clock daemon 
  1436. ctags - build a tags file 
  1437. cut - select out columns of a file 
  1438. date - print or set the date and time 
  1439. dd - disk dumper 
  1440. de - disk editor 
  1441. df - report on free disk space and i-nodes 
  1442. dhrystone - integer benchmark 
  1443. diff - print differences between two files 
  1444. dis88 - disassembler [IBM] 
  1445. diskcheck - check a disk for bad sectors 
  1446. diskcopy - copy a disk with only one drive [AMIGA] 
  1447. diskrtc - set date from a disk controller real time clock [ATARI] 
  1448. diskset - set real time clock on disk controller [ATARI] 
  1449. dosdir - list an MS-DOS directory [IBM] 
  1450. dosread - read a file from an MS-DOS diskette [IBM] 
  1451.  
  1452.  
  1453. SEC.  3.1        PARTIAL LIST OF PROGRAMS SUPPLIED WITH MINIX                29 
  1454.  
  1455. doswrite - write a file onto an MS-DOS diskette [IBM] 
  1456. du - print disk usage 
  1457. echo - print the arguments 
  1458. ed - editor 
  1459. eject - eject a diskette from a drive [MACINTOSH] 
  1460. elle - ELLE Looks Like Emacs 
  1461. elvis - clone of the Berkeley vi editor 
  1462. ex - Berkeley line editor 
  1463. expand - convert tabs to spaces 
  1464. expr - evaluate experession 
  1465. factor - factor an integer less than 2**31 
  1466. fdisk - partition a hard disk [IBM] 
  1467. fgrep - fast grep 
  1468. file - make a guess as to a file's type based on contents 
  1469. find - find files meeting a given condition 
  1470. fix - generate new file from old one and diff listing 
  1471. fold - fold long lines 
  1472. format - format a diskette [ATARI] 
  1473. fortune - print a fortune 
  1474. from - input half of a connection [IBM] 
  1475. fsck - perform file system consistency check 
  1476. gather - gather up the files in a directory for transmission 
  1477. getlf - wait until a line has been typed 
  1478. getty - get terminal line parameters for login 
  1479. grep - search a file for lines containing a given pattern 
  1480. gres - grep and substitute 
  1481. head - print the first few lines of a file 
  1482. hdclose - close hard disk partition [MACINTOSH] 
  1483. hdopen - set correspondence of a HD partition [MACINTOSH] 
  1484. ic - integer calculator 
  1485. id - print the uid and gid 
  1486. ifdef - remove #ifdefs from a file 
  1487. indent - reformat the layout of a program 
  1488. inodes - print i-node information 
  1489. kermit - transfer a file using the kermit protocol 
  1490. kill - send a signal to a process 
  1491. last - display recent on-line session records 
  1492. leave - warn when it is time to go home 
  1493. libpack - pack an ASCII assembly code file [IBM] 
  1494. libupack - convert a packed assembly code file to ASCII [IBM] 
  1495. ln - create a link to a file 
  1496. login - log into the computer 
  1497. look - look up words in dictionary 
  1498. lorder - compute the order for library modules [IBM] 
  1499. lpr - copy a file to the line printer 
  1500. ls - list the contents of a directory 
  1501. m4 - macro processor 
  1502. maccreate - create an empty macintosh file [MACINTOSH] 
  1503. macfile - list, read and write Macintosh volumes [MACINTOSH] 
  1504.  
  1505.  
  1506. 30                       DESCRIPTION OF FULL MINIX 1.5                 CHAP.  3 
  1507.  
  1508. macread - read a Macintosh file [MACINTOSH] 
  1509. macwrite - write a Macintosh file [MACINTOSH] 
  1510. mail - send and receive electronic mail 
  1511. make - a program for maintaining large programs 
  1512. man - display manual page 
  1513. master - control the creation of shervers [IBM] 
  1514. mdb - MINIX debugger [68000] 
  1515. megartc - set date from real time clock [Mega ST] 
  1516. mined - MINIX editor 
  1517. minix - MINIX bootstrap [AMIGA] 
  1518. mkdir - make a directory 
  1519. mkfs - make a file system 
  1520. mknod - create a special file 
  1521. mkproto - create a MINIX prototype file 
  1522. modem - switch the modem and getty state 
  1523. more - pager 
  1524. mount - mount a file system 
  1525. mref - make listing and cross reference map of MINIX 
  1526. mv - move or rename a file 
  1527. nm - print name list 
  1528. nroff - text formatter 
  1529. od - octal dump 
  1530. passwd - change a login password 
  1531. paste - paste multiple files together 
  1532. patch - patches up a file from the original and a diff 
  1533. pr - print a file 
  1534. prep - prepare a text file for statistical analysis 
  1535. pretty - MINIX pretty printer 
  1536. printenv - print out the current environment 
  1537. printroot - print the name of the root device on standard output 
  1538. ps - print process status 
  1539. pwd - print working directory 
  1540. rcp - remote copy [IBM] 
  1541. readall - read a device quickly to check for bad blocks 
  1542. readclock - read the real time clock [IBM PC/AT and AMIGA] 
  1543. readfs - read a MINIX file system 
  1544. recover - recover files that have been removed. 
  1545. ref - look up a reference in a tags file 
  1546. rev - reverse the characters on each line of a file 
  1547. rm - remove a file 
  1548. rmaker - a simple resource compiler [MACINTOSH] 
  1549. rmdir - remove a directory 
  1550. roff - text formatter 
  1551. rsh - remote shell for networking [IBM] 
  1552. rz - receive a file using the zmodem protocol 
  1553. sed - stream editor 
  1554. settype - set type and/or creator of a Mac file [MACINTOSH] 
  1555. sh - shell 
  1556. shar - shell archiver 
  1557.  
  1558.  
  1559. SEC.  3.1        PARTIAL LIST OF PROGRAMS SUPPLIED WITH MINIX                31 
  1560.  
  1561. sherver - shell server [IBM] 
  1562. size - print text, data, and bss size of a program 
  1563. sleep - suspend execution for a given number of seconds 
  1564. sort - sort a file of ASCII lines 
  1565. spell - print all words in a file not present in the dictionary 
  1566. split - split a large file into several smaller files 
  1567. strings - print all the strings in a binary file 
  1568. strip - remove symbol table from executable file 
  1569. stterm - turn system into a dumb terminal [68000] 
  1570. stty - set terminal parameters 
  1571. su - temporarily log in as superuser or another user 
  1572. sum - compute the checksum and block count of a file 
  1573. svc - shell version control system 
  1574. sync - flush the cache to disk 
  1575. sz - send a file using the zmodem protocol 
  1576. tail - print the last few lines of a file 
  1577. tar - tape archiver 
  1578. tee - divert stdin to a file 
  1579. term - turn PC into a dumb terminal [IBM] 
  1580. termcap - print the current termcap entry 
  1581. test - test for a condition 
  1582. time - report how long a command takes 
  1583. to - output half of a connection [IBM] 
  1584. tos - list, read and write TOS file systems [ATARI] 
  1585. touch - update a file's time of last modification 
  1586. tr - translate character codes 
  1587. transfer - read, write and format diskettes [AMIGA] 
  1588. traverse - print directory tree under the named directory 
  1589. treecmp - recursively list differences in two directory trees 
  1590. true - exit with the value true 
  1591. tset - set the $TERM variable 
  1592. tsort - topological sort [IBM] 
  1593. ttt - tic tac toe 
  1594. tty - print the device name of this tty 
  1595. umount - unmount a mounted file system 
  1596. unexpand - convert spaces to tabs 
  1597. uniq - delete consecutive identical lines in a file 
  1598. unshar - Remove files from a shell archive 
  1599. update - periodically write the buffer cache to disk 
  1600. users - list the logged-in users 
  1601. uud - decode a binary file encoded with uue 
  1602. uue - encode a binary file to ASCII (e.g., for mailing) 
  1603. vi - (see elvis) 
  1604. virecover - recover from a crash 
  1605. vol - split stdin into diskette-sized volumes 
  1606. wc - count characters, words, and lines in a file 
  1607. weidertc - set date from Weide real time clock [ATARI] 
  1608. whatsnew - print a newly modified file, marking changes 
  1609. whereis - examine system directories for a given file 
  1610.  
  1611.  
  1612. 32                       DESCRIPTION OF FULL MINIX 1.5                 CHAP.  3 
  1613.  
  1614. which - examine $PATH to see which file will be executed 
  1615. who - print list of currently logged in users 
  1616. whoami - print current user name 
  1617. width - force all the lines of a file to a given width 
  1618. write - send a message to a logged-in user 
  1619.  
  1620.  
  1621. 3.3.  PARTIAL LIST OF THE MINIX LIBRARY 
  1622.  
  1623.    Below is a listing of the three principal library directories, ansi,  posix, 
  1624. and  other.   These  lists are approximate, as there are some minor differences 
  1625. between the various versions.  The sources for all these library  routines  are 
  1626. included in the MINIX package (as are the binaries, of course). 
  1627.  
  1628. 3.3.1.  Ansi Directory 
  1629.  
  1630. Makefile abort abs assert atoi atol  bsearch  ctime  ctype  errno  exit  fclose 
  1631. fflush  fgetc  fgets fopen fprintf fputc fputs fread freopen fseek ftell fwrite 
  1632. getenv gets malloc memchr memcmp memcpy memmove memset perror puts  qsort  rand 
  1633. scanf  setbuf signal sincos sprintf strcat strchr strcmp strcoll strcpy strcspn 
  1634. strerror strlen strncat strncmp strncpy strpbrk strrchr  strspn  strstr  strtok 
  1635. strtol strtoul strxfrm system time tmpnam ungetc vsprintf 
  1636.  
  1637. 3.3.2.  Posix Directory 
  1638.  
  1639. Makefile _exit access alarm chdir chmod  chown  close  closedir  creat  ctermid 
  1640. cuserid  dup  dup2 exec execlp fcntl fdopen fork fpathconf fstat getcwd getegid 
  1641. geteuid getgid getgrent getlogin getpid getppid  getpwent  getuid  isatty  kill 
  1642. link  lseek  mkdir  mkfifo open opendir pathconf pause pipe read readdir rename 
  1643. rewinddir rmdir setgid setuid sleep stat sysconf  times  ttyname  umask  unlink 
  1644. utime wait write 
  1645.  
  1646. 3.3.3.  Other Directory 
  1647.  
  1648. Makefile amoeba bcmp bcopy brk bzero call chroot cleanup crypt curses  doprintf 
  1649. ffs  getdents  getopt  getpass gtty index ioctl itoa lock lrand lsearch memccpy 
  1650. message mknod mktemp mount nlist popen printdat  printk  prints  ptrace  putenv 
  1651. regexp  regsub  rindex  seekdir  stb stderr stime stty swab sync syslib telldir 
  1652. termcap umount uniqport vectab 
  1653.  
  1654.  
  1655. 3.4.  ADDITIONAL SOFTWARE 
  1656.  
  1657.    The MINIX package consists of boot diskettes, the  binaries  of  nearly  200 
  1658. system  utilities,  a  C compiler, the sources of the complete operating system 
  1659. (in C), the sources of the utility programs, and the sources  of  the  library. 
  1660. In  addition,  the  package  contains  ANSI  and  POSIX compatible header files 
  1661. /usr/include/*.h), and extensive test software.  Furthermore, MINIX comes stan- 
  1662. dard  with networking software to connect multiple IBM machines on an Ethernet.  
  1663.  
  1664. SEC.  3.3                     ADDITIONAL SOFTWARE                            33 
  1665.  
  1666. This software allows file transfer, remote login, cross-machine pipes, and many 
  1667. other  features.   One  particularly  interesting aspect of it, is that it also 
  1668. works on a single machine, so you can develop networking software  alone.   The 
  1669. binary  programs  so  produced  will run on a network of MINIX machines without 
  1670. modification or even recompilation. 
  1671.    A Pascal compiler is also available from third-party vendors. 
  1672.    Finally, there is a large  and  active  MINIX  community  that  operates  on 
  1673. USENET.   Over  16,000  people  belong to this group, which is described in the 
  1674. MINIX Reference Manual. 
  1675.  
  1676.  
  1677.  
  1678.  
  1679.                          HOW TO ORDER MINIX 1.5 
  1680.  
  1681.      MINIX is copyrighted software, being sold by Prentice-Hall.  It is not 
  1682. public domain or shareware.  Other than the demonstration disk, MINIX is not 
  1683. available by FTP or from on-line bulletin boards.  The Prentice-Hall product  
  1684. numbers and prices are as follows: 
  1685.  
  1686.   - MINIX 1.5 for the IBM: 5 1/4"   (0-13-585076-2)  $169  
  1687.   - MINIX 1.5 for the IBM: 3 1/2"   (0-13-585068-1)  $169 
  1688.   - MINIX 1.5 for the Amiga        (0-13-585043-6)  $169 
  1689.   - MINIX 1.5 for the Atari        (0-13-585035-5)  $169 
  1690.   - MINIX 1.5 for the Macintosh     (0-13-585050-9)  $169 
  1691.  
  1692. Sales tax and shipping are extra; Prices are slightly higher outside the U.S. 
  1693.  
  1694. All versions include the executable binaries, a detailed manual, the complete  
  1695. source code (on diskettes), and an attractively typeset, cross-referenced 
  1696. listing of the operating system code. 
  1697.  
  1698.      P-H is making a big effort to get software stores to keep MINIX in stock. 
  1699. The easiest way to order it is to go to a software store and ask them for 
  1700. it.  If they don't stock it, they can always order it.  Alternatively, you 
  1701. can order directly by email, FAX, phone, or mail from Prentice-Hall as follows. 
  1702.  
  1703. In North America and the Far East 
  1704.  
  1705.   To order by email:    books@prenhall.com 
  1706.   To order by FAX:      (201) 767-5625 
  1707.   To order by phone:    (800) 624-0023  or  (201) 767-5969 
  1708.   To order by mail:    Microservice Customer Service 
  1709.             Simon & Schuster 
  1710.             200 Old Tappan Road 
  1711.             Old Tappan, NJ 07675 
  1712.  
  1713.  
  1714. In UK/Europe 
  1715.  
  1716.   To order by email:    Not recommended as the email is printed out in the U.S. 
  1717.             and then sent to England by regular letter 
  1718.   To order by FAX:    Same problem as email 
  1719.   To order by phone:    +44 (442) 231-555 (UK number) 
  1720.   To order by mail:    Order Dept. 
  1721.             Prentice-Hall International 
  1722.             66 Wood Lane End 
  1723.             Hemel Hempstead 
  1724.             Herts. HP2 4RG ENGLAND 
  1725.  
  1726. For email and FAX orders, please include the product name and number, your 
  1727. name and address, and your MasterCard or VISA card number and expiration date. 
  1728. If you wish delivery by Federal Express (costs extra), please indicate so. 
  1729.  
  1730.  
  1731.  
  1732. MINIX can also be ordered from the following addresses: 
  1733.  
  1734. In England:    The MINIX Center 
  1735.         Forncett End 
  1736.         Norwich 
  1737.         Norfolk NR16 1HT England 
  1738.         0953-89345 
  1739.  
  1740. In Germany:    Steve Steinkrauss 
  1741.         Feldtorweg 24 
  1742.         D3406 Bovenden 1 
  1743.         Germany 
  1744.  
  1745. In the Benelux:    Fred van Kempen 
  1746.         Postbus 184 
  1747.         2100 AD Heemstede 
  1748.         Holland 
  1749.         Tel: +31 23 287935 
  1750.         FAX: +31 23 294229 
  1751.  
  1752. In Scandinavia:    Frank O'Donell 
  1753.         P.O. Box 88 
  1754.         1371 Asker 
  1755.         Norway 
  1756.  
  1757. In Spain and    Deborah Worth 
  1758.    Portugal:    Appartado Numero 50672 
  1759.         Madrid 
  1760.         Spain 
  1761.  
  1762. In Italy:    Jim Blaho 
  1763.                 Piazza Santo Spirito 17 
  1764.                 50125 Florence 
  1765.         Italy 
  1766.  
  1767. In Greece:    Vassilis Zahos 
  1768.         Kritonos 5-7 
  1769.         GR 11634 Athens 
  1770.         Greece 
  1771.  
  1772. In Turkey:    Atilla Gullu 
  1773.         Milli Mudafaa Cad 14/7 
  1774.         Kizilay Ankara 
  1775.         Turkey 
  1776.  
  1777.      If you have previously purchased MINIX from Prentice-Hall, you can get 
  1778. a discount of $60, but only if you order by mail and include the label from  
  1779. the original PH boot disk (or the entire disk) with your letter.  Not valid for  
  1780. email, phone or FAX orders since you must enclose the original boot disk label 
  1781. (not a photocopy).  Mail orders can be by credit card or check for $169.  You  
  1782. will be billed for tax and shipping. 
  1783.